package com.xsh.gls.service.impl;

import com.xsh.gls.mapper.UserMapper;
import com.xsh.gls.mapper.User_TypeMapper;
import com.xsh.gls.pojo.User;
import com.xsh.gls.pojo.User_Type;
import com.xsh.gls.service.UserTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserTypeServiceImpl implements UserTypeService {
    @Autowired
    private User_TypeMapper user_typeMapper;
    @Autowired
    private UserMapper userMapper;
    @Override
    public List<User_Type> queryAll() throws Exception {
        return user_typeMapper.selectAll();
    }

    @Override
    public boolean delById(Integer id) throws Exception {
        if(user_typeMapper.upeateById(id)==1){
            if(userMapper.upeateById(id)>0){
                return true;
            }
        }
        return false;
    }
}
